package com.sys.basics.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sys.basics.entity.SysRole;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sys.basics.entity.vo.RoleResourceVo;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;


/**
 * @author: ares
 * @date: 2021-10-08
 * @description: 角色表 服务类
 */
public interface SysRoleService extends IService<SysRole> {

    List<SysRole> getListByUserAndOrg(Long userId, Long orgId);

    IPage<SysRole> getPagesByOrg(Page<SysRole> page, Long orgId, SysRole roleParams);

    SysRole getByOrgAndName(Long orgId, String roleName);

    int createRoleLinkResource(@Valid RoleResourceVo role);

    int updateRoleLinkResource(@Valid RoleResourceVo role);

    boolean removeRoleAndLinkedResourceById(Long roleId);
}
